package com.kuang.future;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;

public class demo01 {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
       CompletableFuture completableFuture = CompletableFuture.runAsync(()->{
            try {
                TimeUnit.SECONDS.sleep(2);
            }catch (Exception e){
                e.printStackTrace();
            }
           System.out.println(Thread.currentThread().getName());


        }
        );
        System.out.println("223232");
       completableFuture.get();
    }
}
